package org.cpar.compiler.nodes;

import java.util.List;

import org.antlr.runtime.Token;
import org.antlr.runtime.tree.Tree;
import org.cpar.compiler.CPARNode;
import org.cpar.compiler.ICodeWriter;

public class ParallelBlock extends CPARNode {

	public ParallelBlock(ParallelBlock t) {
		super(t);
	}

	public ParallelBlock(Token nextToken) {
		super(nextToken);
	}

	@Override
	public void accept(ICodeWriter writer) {
		writer.visit(this);
	}

	@Override
	public Tree dupNode() {
		return new ParallelBlock(this);
	}

	@SuppressWarnings("unchecked")
	public List<CPARNode> getBlocks() {
		return (List<CPARNode>) ((CPARNode) getChild(0)).getChildren();
	}

	public CPARNode getEndMark() {
		return (CPARNode) getChild(1);
	}
}
